/**
 * 报价
 * Created by douxc on 2015/4/21.
 */
define(function (require, exports, module) {
  'use strict';
  module.exports = function (app) {
    app.register.controller("QuoteCtrl", ["$scope", "$location", "MHService", function ($scope, $location, MHService) {
      var feeds = MHService.cacheData(false, {key: 'materialList'});//读取需要显示的数据
      var _feeds = [];
      angular.forEach(feeds, function (obj) {
        var tf = {
          name: obj.name
//          time: obj[7]
        };
        _feeds.push(tf);//需要显示的数据
      });
      $scope.repeat = _feeds;
      /**
       * 删除材料
       * @param index
       */
      $scope.deleteFeed = function (index) {
        _feeds.splice(index, 1);
        feeds.splice(index, 1);
//          console.log("1111",feeds);
        MHService.cacheData(true, {key: 'materialList', value: feeds});
      };


        var isShow = false;
        MHService.globalData(true, {key: 'isShow', value : isShow});
    }]);
  };
});
